{% extends 'base_auth.html' %}

{% block title %}重置密码 - EasyTesting{% endblock %}

{% block content %}
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-6 col-lg-5">
            <div class="card shadow-sm border-0 mt-5">
                <div class="card-body p-5">
                    <div class="text-center mb-4">
                        <h1 class="h3 mb-3 fw-normal">重置密码</h1>
                        <p class="text-muted">请输入您的电子邮件地址，我们将向您发送重置密码的链接。</p>
                    </div>
                    
                    {% if form.errors %}
                    <div class="alert alert-danger">
                        <i class="bi bi-exclamation-triangle-fill me-2"></i>
                        请修正以下错误:
                        <ul class="mb-0 mt-2">
                            {% for field in form %}
                                {% for error in field.errors %}
                                <li>{{ field.label }}: {{ error }}</li>
                                {% endfor %}
                            {% endfor %}
                        </ul>
                    </div>
                    {% endif %}
                    
                    <form method="post">
                        {% csrf_token %}
                        <div class="mb-4">
                            <label for="id_email" class="form-label">电子邮件</label>
                            <div class="input-group">
                                <span class="input-group-text"><i class="bi bi-envelope"></i></span>
                                <input type="email" name="email" id="id_email" class="form-control" placeholder="输入您的电子邮件" required autofocus>
                            </div>
                        </div>
                        
                        <button class="w-100 btn btn-primary" type="submit">
                            <i class="bi bi-envelope me-2"></i>发送重置链接
                        </button>
                        
                        <div class="text-center mt-4">
                            <a href="{% url 'login' %}" class="text-decoration-none">
                                <i class="bi bi-arrow-left me-1"></i>返回登录
                            </a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
